<?php

namespace App\Http\Requests\User;


use App\Http\Requests\AbstractBaseRequest;

class RegisterRequest extends AbstractBaseRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'mobile' => ['required'],
            'password' => ['required', 'string', 'between:6,20'],
            'pay_pass' => ['required', 'string', 'between:6,20'],
            'invite_code' => ['required', 'alpha_num'],
//            'verify_code' => ['required', 'digits:6'],
            'tpl' => ['required', 'in:1,2'],
        ];
    }

    public function attributes(): array
    {
        return [
            'mobile' => trans('手机号'),
            'password' => trans('登录密码'),
            'pay_pass' => trans('安全密码'),
            'invite_code' => trans('邀请码'),
            'verify_code' => trans('短信验证码'),
            'tpl' => trans('安置位置'),
        ];
    }

    public function messages(): array
    {
        return [
            'account.unique' => trans('用户名已存在'),
        ];
    }

}
